package org.cloud.module.common.model;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;

import lombok.NoArgsConstructor;

/**
 * 分页模型
 * @author wangyuan
 * @since 2019年6月30日 上午12:17:59
 *
 */
@NoArgsConstructor
public class Page<T> implements IPage<T> {
    
    /**
     * 
     */
    private static final long serialVersionUID = 2323381326991380336L;

    /**
     * 查询数据列表
     */
    private List<T> records = Collections.emptyList();

    /**
     * 总数
     */
    private long total = 0;
    /**
     * 每页显示条数，默认 10
     */
    private long limit = 10;

    /**
     * 当前页
     */
    private long page = 1;

    /**
     * 排序字段信息
     */
    private List<OrderItem> orders = new ArrayList<>();

    /**
     * 自动优化 COUNT SQL
     */
    private boolean optimizeCountSql = true;
    /**
     * 是否进行 count 查询
     */
    private boolean isSearchCount = true;

    @Override
    public List<OrderItem> orders() {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public List<T> getRecords() {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public IPage<T> setRecords(List<T> records) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public long getTotal() {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public IPage<T> setTotal(long total) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public long getSize() {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public IPage<T> setSize(long size) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public long getCurrent() {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public IPage<T> setCurrent(long current) {
        // TODO Auto-generated method stub
        return null;
    }

}
